<template>
  <el-drawer
    title="备案申请"
    :visible.sync="drawer"
    direction="rtl"
    :before-close="handleClose"
    size="1000px"
  >
    <div class="bock">
      <el-form
        ref="Form"
        :model="form_data"
        size="mini"
        label-position="right"
        label-width="110px"
        :rules="rules"
      >
        <el-collapse v-model="activeNames">
          <el-collapse-item title="基本信息" name="1">
            <el-col :span="12">
              <el-form-item label="电子屏编号" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入电子屏编号"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所在场所" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在场所"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所在区域" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所属行业" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所属街道" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="具体地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="安装位置" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="屏幕面积" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="安装方式" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联网方式" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
          <el-collapse-item title="责任单位信息" name="2">
            <el-col :span="12">
              <el-form-item label="责任单位" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="上级主管部门" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="责任人姓名" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="责任人手机" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="责任人邮箱" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
          <el-collapse-item title="运维信息" name="3">
            <el-col :span="12">
              <el-form-item label="建设运维单位" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="责任人及电话" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="运维人员及电话" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
          <el-collapse-item title="播系统信息" name="4">
            <el-col :span="12">
              <el-form-item label="联网播控情况" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="播控系统名称" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="ip地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="网址/app名称" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="运营单位" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="负责人" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="负责人电话" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入所在区域"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
        </el-collapse>
      </el-form>
    </div>
    <div class="drawerBtn">
      <el-button size="mini">取 消</el-button>
      <el-button size="mini" type="primary" @click="submit">确 认</el-button>
      <el-button size="mini" type="primary">暂 存</el-button>
    </div>
  </el-drawer>
</template>
<script>
export default {
  data() {
    return {
      drawer: false,
      activeNames: "1",
      form_data: {
        EVALUATE: "",
        PROCESS_NAME: "",
      },
      rules: {
        EVALUATE: [
          { required: true, message: "请输入评价", trigger: "blur" },
          {
            min: 1,
            max: 100,
            message: "长度在 1 到 100 个字符",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    isShow() {
      this.drawer = true;
    },
    submit() {
      this.$refs["Form"].validate((valid) => {
        if (valid) {
          let data = {
            MOR_BEHA_EVALUATE: this.form_data.EVALUATE,
            EVALUATION_SCORE_ID: this.data.EVALUATION_SCORE_ID,
          };
          this.loading = true;
          addEvaluate(data)
            .then((res) => {
              this.$message.success("评价成功");
              this.loading = false;
              this.$emit("submit");
              this.show = false;
            })
            .catch(() => {});
        } else {
          return false;
        }
      });
    },
    handleClose() {
      this.drawer = false;
    },
  },
};
</script>
<style scoped>
.bock {
  padding: 0px 20px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
</style>